package com.dongjiantong.web.boss.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongjiantong.common.model.Response;
import com.dongjiantong.openplatform.annotations.OpenBean;
import com.dongjiantong.openplatform.annotations.OpenMethod;
import com.dongjiantong.sys.model.DicData;
import com.dongjiantong.sys.service.DicDataService;
import com.dongjiantong.user.model.LoginUser;
import com.dongjiantong.user.model.MzUser;
import com.dongjiantong.user.service.MzUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import java.util.List;

/**
 * 开户后，配置信息
 * @author cao
 * @create 2017-12-20 下午1:24
 **/
@Slf4j
@OpenBean
public class RegionSettingController {

    @Reference(version = "1.0.0")
    public DicDataService dicDataService;

    @Reference(version = "1.0.0")
    public MzUserService mzUserService;

    /**
     * 取系统模块
     * @return
     */
    //@GetMapping("/querySysModule")
    @OpenMethod(
            key = "boss.setting.querySysModule",
            paramNames = {},
            httpMethods = RequestMethod.GET
    )
    public Response<List<DicData>> querySysModule(){
        return Response.ok(dicDataService.queryGlobalModule());
    }


    /**
     * 查询区域管理员的帐号
     * @param accountId
     * @return
     */
    @OpenMethod(
            key = "boss.setting.queryAdminAccount",
            paramNames = {"accountId"},
            httpMethods = RequestMethod.GET
    )
    public Response<MzUser> queryAdminAccount(long accountId)
    {
      return Response.ok(mzUserService.queryAdminAccount(accountId));
    }
}
